package com.shanzmoo.admin.domain.dto;

import cn.hutool.core.bean.BeanUtil;
import com.shanzmoo.db.store.entity.StoreDeliveryBillEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 仓库发货单 发货信息
 *
 * @author： Gzhao 2021/3/12
 */
@Data
@ApiModel("仓库发货单-发货信息")
public class StoreDeliveryBillSendDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "发货单id不允许为空")
    @ApiModelProperty(value = "发货单id")
    private Integer id;

    @NotEmpty(message = "物流单号不允许为空")
    @ApiModelProperty(value = "物流单号")
    private String logisticsNo;

    @NotEmpty(message = "物流公司不允许为空")
    @ApiModelProperty(value = "物流公司")
    private String logisticsCompany;

    @NotEmpty(message = "收件人不允许为空")
    @ApiModelProperty(value = "收件人")
    private String consignee;

    @NotEmpty(message = "联系方式不允许为空")
    @ApiModelProperty(value = "收件人手机")
    private String consigneeMobile;

    @NotEmpty(message = "省市区不允许为空")
    @ApiModelProperty(value = "收件人所在省市区")
    private String consigneeDistrict;

    @NotEmpty(message = "详细地址不允许为空")
    @ApiModelProperty(value = "收件人详细地址")
    private String consigneeAddress;

    @ApiModelProperty(value = "备注")
    private String remark;

    public StoreDeliveryBillEntity convertEntity() {
        StoreDeliveryBillEntity target = new StoreDeliveryBillEntity();
        BeanUtil.copyProperties(this, target, true);
        return target;
    }
}
